From: Florian Müllner Date: Wed, 6 Nov 2024 13:46:31 +0000 (+0100) Subject: st: Fix closure annotations X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~173^2^2~178 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=411fe9c42f1e4617ddbdd5207998b67abe036806;p=gnome-shell.git st: Fix closure annotations Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/: Whenever you’re describing a function that takes a callback, you should always annotate the callback argument with the argument that contains the user data using the (closure argument) annotation You should not annotate the data argument with a unary (closure). The unary (closure) is meant to be used when annotating the callback type Recently gobject-introspection became a bit more strict with this and that generated some warnings: Warning: St: invalid "closure" annotation: only valid on callback parameters This commit fix all the closure annotations. Part-of: --- diff --git a/src/st/st-icon-theme.c b/src/st/st-icon-theme.c index 7223c33ab..4563c0df0 100644 --- a/src/st/st-icon-theme.c +++ b/src/st/st-icon-theme.c @@ -3494,9 +3494,9 @@ load_icon_thread (GTask *task, * st_icon_info_load_icon_async: * @icon_info: a #StIconInfo * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore - * @callback: (scope async): a #GAsyncReadyCallback to call when the + * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the * request is satisfied - * @user_data: (closure): the data to pass to callback function + * @user_data: the data to pass to callback function * * Asynchronously load, render and scale an icon previously looked up * from the icon theme using [method@St.IconTheme.lookup_icon]. @@ -4039,9 +4039,9 @@ load_symbolic_icon_thread (GTask *task, * success colors of the icon * @cancellable: (allow-none): optional #GCancellable object, * %NULL to ignore - * @callback: (scope async): a #GAsyncReadyCallback to call when the + * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the * request is satisfied - * @user_data: (closure): the data to pass to callback function + * @user_data: the data to pass to callback function * * Asynchronously load, render and scale a symbolic icon previously looked up * from the icon theme using [method@St.IconTheme.lookup_icon].